#ifndef OPERATIONS_DASHBOARD_H
#define OPERATIONS_DASHBOARD_H

#include <QWidget>
#include "ui_opreatons.h"
#include "operations_management.h"
#include "operations_order.h"
#include "operations_user_service.h"
#include "operations_data_statistics.h"
#include "api.h"

class operations_dashboard : public QWidget
{
    Q_OBJECT

public:
    explicit operations_dashboard(QWidget *parent = nullptr);
    ~operations_dashboard();

protected:
    void closeEvent(QCloseEvent *event) override;

private slots:
    void onTicketManagementButtonClicked();
    void onOrderProcessingButtonClicked();
    void onCustomerServiceButtonClicked();
    void onDataAnalyticsButtonClicked();
    void onSubWindowDestroyed(QObject *obj);

private:
    void setupConnections();
    void updateDashboardData();
    void closeAllSubWindows();
    
    Ui::operations_dashboard *ui;
    
    // 子界面指针
    operations_management *ticketManagementWindow;
    operations_order *orderProcessingWindow;
    operations_user_service *customerServiceWindow;
    operations_data_statistics *dataAnalyticsWindow;
};

#endif // OPERATIONS_DASHBOARD_H
